/* 简洁的工具调用样式 - 统一规则 */

/* 基础样式 */
.message-content strong {
	color: #1890ff;
	font-weight: 600;
}

/* 工具选择中状态样式 - 【高性能优化版本】 */
.tool-selecting-msg {
	margin: 8px 0;
	padding: 8px 12px;
	background-color: #f0f8ff;
	border-left: 4px solid #1890ff;
	border-radius: 4px;
	position: relative;
	transition: all 0.3s ease; /* 平滑过渡效果 */
}

.tool-selecting-msg strong {
	color: #1890ff;
	font-weight: 600;
}

/* 【简化状态管理】选择中 -> 执行中的颜色变化 */
.tool-selecting-msg.tool-write-loading {
	background-color: #fff7e6 !important;
	border-left-color: #fa8c16 !important;
}

.tool-selecting-msg.tool-write-loading strong {
	color: #fa8c16 !important;
}

/* ⚡闪电符号样式 - 黄色高亮 */
.tool-lightning {
	color: #faad14;
	font-weight: bold;
	text-shadow: 0 0 3px rgba(250, 173, 20, 0.3);
	animation: lightning-glow 2s ease-in-out infinite alternate;
}

/* 工具选择时的加载动画 - 统一转圈效果 */
.tool-selecting-msg::after {
	content: '';
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 2px solid #1890ff;
	border-top: 2px solid transparent;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-left: 8px;
	vertical-align: middle;
}

/* 【修复】写入文件时使用绿色转圈替代蓝色转圈 */
.tool-write-loading::after {
	content: '';
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 2px solid #ff8c00 !important;
	border-top: 2px solid transparent !important;
	border-radius: 50%;
	animation: spin 1.2s linear infinite;
	margin-left: 8px;
	vertical-align: middle;
}

/* 核心动画定义 */
@keyframes selectingTimeout {
	0%,
	95% {
		opacity: 1;
	}
	100% {
		opacity: 0.5;
		background-color: #fff7e6;
		border-left-color: #fa8c16;
	}
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* ⚡闪电符号闪烁动画 */
@keyframes lightning-glow {
	from {
		text-shadow: 0 0 3px rgba(250, 173, 20, 0.3);
		transform: scale(1);
	}
	to {
		text-shadow: 0 0 6px rgba(250, 173, 20, 0.6);
		transform: scale(1.05);
	}
}

/* 统一的工具调用完成样式基类 */
.tool-delete-msg,
.tool-folder-msg,
.tool-replace-msg,
.tool-read-msg,
.tool-write-msg,
.tool-exit-msg,
.tool-completed-msg,
.tool-search-msg,
.tool-command-msg,
.tool-modify-msg {
	margin: 8px 0;
	padding: 8px 12px;
	border-radius: 4px;
	border-left: 4px solid;
	position: relative;
}

/* 移除转圈样式的类 */
.tool-selecting-msg.completed,
.tool-selecting-msg.no-spinner {
	background-color: #f6ffed !important;
	border-left-color: #ff8c00 !important;
}

.tool-selecting-msg.completed strong,
.tool-selecting-msg.no-spinner strong {
	color: #ff8c00 !important;
}

.tool-selecting-msg.completed::after,
.tool-selecting-msg.no-spinner::after {
	display: none !important;
}

/* 🗑️ 删除文件工具样式 - 红色 */
.tool-delete-msg {
	background-color: #fff2f0;
	border-left-color: #ff4d4f;
}

.tool-delete-msg strong {
	color: #ff4d4f;
	font-weight: 600;
}

/* 🗂️ 文件夹操作工具样式 - 紫色 */
.tool-folder-msg {
	background-color: #f9f0ff;
	border-left-color: #722ed1;
}

.tool-folder-msg strong {
	color: #722ed1;
	font-weight: 600;
}

/* 🔧 替换文件工具样式 - 蓝色 */
.tool-replace-msg {
	background-color: #e6f7ff;
	border-left-color: #1890ff;
}

.tool-replace-msg strong {
	color: #1890ff;
	font-weight: 600;
}

/* 📖 读取文件工具样式 - 青色 */
.tool-read-msg {
	background-color: #e6fffb;
	border-left-color: #13c2c2;
}

.tool-read-msg strong {
	color: #13c2c2;
	font-weight: 600;
}

/* ✏️ 写入文件工具样式 - 橙色 */
.tool-write-msg {
	background-color: #fff7e6;
	border-left-color: #ff8c00;
}

.tool-write-msg strong {
	color: #ff8c00;
	font-weight: 600;
}

/* 🏁 退出工具样式 - 紫色 */
.tool-exit-msg {
	background-color: #f9f0ff;
	border-left-color: #8e44ad;
}

.tool-exit-msg strong {
	color: #8e44ad;
	font-weight: 600;
}

/* ✅ 通用完成状态样式 - 橙色 */
.tool-completed-msg {
	background-color: #fff7e6;
	border-left-color: #ff8c00;
}

.tool-completed-msg strong {
	color: #ff8c00;
	font-weight: 600;
}

/* 🔍 搜索代码库工具样式 - 深蓝色 */
.tool-search-msg {
	background-color: #e6f4ff;
	border-left-color: #1677ff;
}

.tool-search-msg strong {
	color: #1677ff;
	font-weight: 600;
}

/* ⚡ 运行命令工具样式 - 金色 */
.tool-command-msg {
	background-color: #fffbe6;
	border-left-color: #faad14;
}

.tool-command-msg strong {
	color: #faad14;
	font-weight: 600;
}

/* 🔧 修改文件工具样式 - 橙色 */
.tool-modify-msg {
	background-color: #fff7e6;
	border-left-color: #fa8c16;
}

.tool-modify-msg strong {
	color: #fa8c16;
	font-weight: 600;
}

/* 代码块样式优化 */
.message-content pre {
	margin: 8px 0;
	border-radius: 6px;
	overflow-x: auto;
	background-color: #f6f8fa;
	border: 1px solid #e1e4e8;
}

.message-content pre code {
	padding: 12px;
	display: block;
	font-size: 0.85em;
	line-height: 1.5;
	background: none;
	color: #24292e;
	font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

/* 响应式适配 */
@media (max-width: 768px) {
	.tool-delete-msg,
	.tool-folder-msg,
	.tool-replace-msg,
	.tool-read-msg,
	.tool-write-msg,
	.tool-exit-msg,
	.tool-completed-msg,
	.tool-selecting-msg {
		margin: 6px 0;
		padding: 6px 10px;
		font-size: 14px;
	}

	.tool-selecting-msg::after,
	.tool-write-loading::after {
		width: 10px;
		height: 10px;
		margin-left: 6px;
	}

	.tool-lightning {
		font-size: 0.9em;
	}

	.message-content pre code {
		font-size: 0.8em;
		padding: 10px;
	}
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
	.tool-selecting-msg {
		background-color: #1e2327;
		border-color: #58a6ff;
	}

	.tool-selecting-msg strong {
		color: #58a6ff;
	}

	.tool-selecting-msg::after {
		border-color: #58a6ff;
		border-top-color: transparent;
	}

	.tool-delete-msg {
		background-color: #2d1b1e;
		border-color: #f85149;
	}

	.tool-delete-msg strong {
		color: #f85149;
	}

	.tool-folder-msg {
		background-color: #251e2d;
		border-color: #a5a5f0;
	}

	.tool-folder-msg strong {
		color: #a5a5f0;
	}

	.tool-replace-msg {
		background-color: #1e2327;
		border-color: #58a6ff;
	}

	.tool-replace-msg strong {
		color: #58a6ff;
	}

	.tool-read-msg {
		background-color: #1e2d2b;
		border-color: #56d4dd;
	}

	.tool-read-msg strong {
		color: #56d4dd;
	}

	.tool-write-msg,
	.tool-completed-msg {
		background-color: #1e2327;
		border-color: #7ee787;
	}

	.tool-write-msg strong,
	.tool-completed-msg strong {
		color: #7ee787;
	}

	.tool-exit-msg {
		background-color: #2d1e2d;
		border-color: #d19fe8;
	}

	.tool-exit-msg strong {
		color: #d19fe8;
	}

	.message-content strong {
		color: #58a6ff;
	}

	.tool-search-msg {
		background-color: #1e2327;
		border-color: #58a6ff;
	}

	.tool-search-msg strong {
		color: #58a6ff;
	}

	.tool-command-msg {
		background-color: #2d2a1e;
		border-color: #f2cc60;
	}

	.tool-command-msg strong {
		color: #f2cc60;
	}

	.tool-modify-msg {
		background-color: #2d251e;
		border-color: #ffa94d;
	}

	.tool-modify-msg strong {
		color: #ffa94d;
	}

	.message-content pre {
		background-color: #161b22;
		border-color: #30363d;
	}

	.message-content pre code {
		color: #e6edf3;
	}
}
